package com.ourgame.tankgame;

import com.jme3.app.SimpleApplication;
import com.jme3.bullet.BulletAppState;
import com.jme3.system.AppSettings;
import com.ourgame.tankgame.control.WorldManagerState;
import gameutil.Globals;

/**
 *
 * @author Lcn
 */
public class TankGame extends SimpleApplication {

    public static void main(String[] args) {
        TankGame app = new TankGame();
        app.start();
    }

    @Override
    public void simpleInitApp() {
        /*
         * 载入世界管理器
         */
        WorldManagerState woldManager = new WorldManagerState();
        stateManager.attach(woldManager);

//        UIState uiState = new UIState();
//        stateManager.attach(uiState);

        /*
         * 载入物理系统
         */
        BulletAppState bulletState = new BulletAppState();
        if (Globals.PHYSICS_THREADED) {
            bulletState.setThreadingType(BulletAppState.ThreadingType.PARALLEL);
        }
        stateManager.attach(bulletState);
        bulletState.getPhysicsSpace().setAccuracy(Globals.PHYSICS_FPS);
        if (Globals.PHYSICS_DEBUG) {
            bulletState.getPhysicsSpace().enableDebug(assetManager);
        }

    }
}
